﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;

namespace HYRElectric.PowerSystem
{
	internal class ElectricFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			ConnectorSetIterator connectorSetIterator = (elem as FamilyInstance).MEPModel.ConnectorManager.Connectors.ForwardIterator();
			while (connectorSetIterator.MoveNext())
			{
				if ((connectorSetIterator.Current as Connector).Domain == (Autodesk.Revit.DB.Domain)2)
				{
					return true;
				}
			}
			return false;
		}

		public bool AllowReference(Reference reference, XYZ position)
		{
			throw new NotImplementedException();
		}
	}
}
